package com.polaris.live.adapter.live

import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.AdapterLiveCounsumeBinding
import com.polaris.live.resp.back_resp.LiveConsumptionUserVo
import com.polaris.live.widget.avatar.FrameImageUtils

/**
 * LiveConsumeAdapter
 *
 * @author Created by 半仙 on 2023/10/9/009 10:04
 */
class LiveConsumeAdapter : BaseBindingAdapter<AdapterLiveCounsumeBinding, LiveConsumptionUserVo>() {

    override fun convert(
        holder: VBViewHolder<AdapterLiveCounsumeBinding>,
        item: LiveConsumptionUserVo,
    ) {
        holder.vb.apply {
            userAvatar.setImageUrl(item.avatar, item.userId)
            avFv.setFrameImage(FrameImageUtils.urlToFrameImageBean(item.avatarFrame))
        }
    }

}